Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

router indexer functionality #29

Open
wants to merge 15 commits into
base: rain-fork
Choose a base branch
from

Conversation

rouzwelt
Copy link
Collaborator

@rouzwelt rouzwelt commented Nov 28, 2024

Motivation

resolves #28

Solution

This PR divides some big class methods of UniswapV3Base that have a lot of contract calls inside (getting pool reserves, getting pools liquidity, getting pools ticks), to smaller units that each do one specific contract call, in order to open up the path for each method to be called elsewhere individually if needed (in this case for calling them when some pools needs updating their data), as well as allows child classes (unique dexes) to override those methods as they need, since not all dexes have the exacts same Contract ABI and need the contract calls to be specific for them (this covers almost all of the deletion diffs in this PR).
Next some new methods added to handle pool data update with contract logs (work as indexer), this is a new feature that allows updating pool data for each dex, the old way of getting pool data is still in place, ie using direct contract calls to get/update pool data.

Checks

By submitting this for review, I'm confirming I've done the following:

  • made this PR as small as possible
  • unit-tested any new functionality
  • linked any relevant issues or PRs
  • included screenshots (if this involves a front-end change)

@rouzwelt rouzwelt added the new feature Added a new feature label Nov 28, 2024
@rouzwelt rouzwelt self-assigned this Nov 28, 2024
Copy link

@thedavidmeister thedavidmeister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high level review is that this would be a fairly large change from the upstream

i'm concerned that making such large changes is going down a road of divergence from what is supported, and at what point are we better off writing our own logic vs. rewriting large amounts of someone else's logic?

Copy link

@thedavidmeister thedavidmeister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not clear to me how the latest updates addresses my last review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature Added a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

provide functionality for router to be able to work like an indexer
2 participants